package com.bcfrj.shop.service.impl;

import com.bcfrj.shop.mapper.GoodMapper;
import com.bcfrj.shop.pojo.Good;
import com.bcfrj.shop.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class GoodServiceImpl implements GoodService {
    @Autowired
    private GoodMapper goodMapper;
    @Override
    public List<Good> queryGoodAll() {
        List<Good> goodList = goodMapper.queryGoodAll();
        return goodList;
    }

    @Override
    public Good queryGoodById(Integer Good_id) {
        Good good = goodMapper.queryGoodById(Good_id);
        return good;
    }

    @Override
    public Integer insertGood(Good good) {
        Integer rows = goodMapper.insertGood(good);
        return rows;
    }

    @Override
    public Integer updateGood(Good good) {
        Integer rows = goodMapper.updateGood(good);
        return rows;
    }

    @Override
    public Integer deleteGood(Integer Good_id) {
        Integer rows = goodMapper.deleteGood(Good_id);
        return rows;
    }
}
